#include "Soldier.h"

unsigned int Soldier::s_iSoldierID = 0;

Soldier::Soldier( SOLDIER_RACE race,
				 SOLDIER_TYPE type, 
				 SOLDIER_COLOR color, 
				 unsigned char hight, 
				 unsigned char width )
				 : m_iID(++s_iSoldierID)
				 , m_eRace(race)
				 , m_eType(type)
				 , m_eColor(color)
				 , m_cHight(hight)
				 , m_cWidth(width)
{
	m_pcMap = new unsigned int[(unsigned int)m_cHight * m_cWidth];

	for(unsigned int i = 0; i < (unsigned int)m_cHight * m_cWidth; ++i)
	{
		m_pcMap[i] = 0;
	}
}

Soldier::~Soldier()
{
	delete[] m_pcMap;
	m_pcMap = 0;
}

unsigned int Soldier::GetID() const
{
	return m_iID;
}

SOLDIER_RACE Soldier::GetRace() const
{
	return m_eRace;
}

SOLDIER_TYPE Soldier::GetType() const
{
	return m_eType;
}

SOLDIER_COLOR Soldier::GetColor() const
{
	return m_eColor;
}

unsigned char Soldier::GetHight() const
{
	return m_cHight;
}

unsigned char Soldier::GetWidth() const
{
	return m_cWidth;
}

void Soldier::SetOwnMap( unsigned int* pMap )
{
	m_pcMap = pMap;
}

const unsigned int* Soldier::GetOwnMap()
{
	return m_pcMap;
}
